package cn.skyclass.net
{
	/**
	 * 设置 RpcHelper 提示信息的工具类
	 * @author fl
	 */	
	 
	import mx.utils.StringUtil;
	
	public class TipsUtil
	{
		public function TipsUtil()
		{
		}

		public static function setLoaderTips(rh:RpcHelper, dataName:String="", 
			hasSuccessfulTip:Boolean=false, alertFaild:Boolean=false):void{
			
			rh.tipMsg = "正在加载" + dataName + "，请稍候";
			rh.tipFaildMsg = "加载" + dataName + "失败，请重试";
			if(hasSuccessfulTip){
				rh.tipSuccessfulMsg = dataName + "已加载";
			}
			if(alertFaild){
				rh.alertFaildMsg = rh.tipFaildMsg;
			}
		}

		public static function setSubmitterTips(rh:RpcHelper, dataName:String="",
			hasSuccessfulTip:Boolean=true, alertFaild:Boolean=false):void{
			
			rh.tipMsg = "正在提交" + dataName + "，请稍候";
			rh.tipFaildMsg = "提交" + dataName + "失败，请重试";
			if(hasSuccessfulTip){
				rh.tipSuccessfulMsg = dataName + "已提交";
			}
			if(alertFaild){
				rh.alertFaildMsg = rh.tipFaildMsg;
			}
			if(alertFaild){
				rh.alertFaildMsg = rh.tipFaildMsg;
			}
		}

		public static function setDeleterTips(rh:RpcHelper, dataName:String="", 
			hasSuccessfulTip:Boolean=true, alertFaild:Boolean=false):void{
			
			rh.tipMsg = "正在删除" + dataName + "，请稍候";
			rh.tipFaildMsg = "删除" + dataName + "失败，请重试";
			if(hasSuccessfulTip){
				rh.tipSuccessfulMsg = dataName + "已删除";
			}
			if(alertFaild){
				rh.alertFaildMsg = rh.tipFaildMsg;
			}
		}
		
	}
}